<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <input type="text" id="inputId" value="zhangsan"> <br>
    <input type="button" value="点我" onclick="clickMe()">

    <script>
        function clickMe() {
            //内置对象：已经new好对象，名字也起好了，直接用
            // var inputObj = document.getElementById('inputId')
            // console.log(inputObj.value);

            var array = document.getElementsByTagName('input');
            console.log(array);
            console.log(array[0]);
            console.log(array[0].value);
            var value = document.getElementsByTagName('input')[0].value;
            console.log(value);
        }
    </script>
</body>
</html>